package com.huawei.appgallery.forum.posts.card;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appgallery.forum.base.card.ForumCard;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import o.azb;
import o.bzd.b;
import o.bzd.j;
import o.cgz;
import o.chy;
import o.eqx;
import o.evx;

public class ForumRecommendCard extends ForumCard {
    protected TextView ˊ;
    protected ImageView ˋ;
    protected TextView ˎ;
    protected TextView ˏ;
    protected TextView ॱ;

    public ForumRecommendCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        ʽ(view);
        azb.ॱ(view, b.ᐝˊ);
        this.ˋ = (ImageView) view.findViewById(b.ˎ);
        this.ˊ = (TextView) view.findViewById(b.ॱ);
        this.ॱ = (TextView) view.findViewById(b.ˋ);
        this.ˎ = (TextView) view.findViewById(b.ˏ);
        this.ˏ = (TextView) view.findViewById(b.ˊ);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof ForumRecommendCardBean) {
            ForumRecommendCardBean forumRecommendCardBean = (ForumRecommendCardBean) cardBean;
            eqx.ˏ(this.ˋ, forumRecommendCardBean.ॱˌ(), "app_default_icon");
            if (TextUtils.isEmpty(forumRecommendCardBean.ˊ())) {
                this.ॱ.setVisibility(8);
                this.ˊ.setVisibility(8);
                this.ˎ.setVisibility(0);
                this.ˎ.setText(forumRecommendCardBean.v_());
            } else {
                this.ˎ.setVisibility(8);
                this.ˊ.setVisibility(0);
                this.ˊ.setText(forumRecommendCardBean.v_());
                this.ॱ.setVisibility(0);
                this.ॱ.setText(forumRecommendCardBean.ˊ());
            }
            if (forumRecommendCardBean.ʽ()) {
                this.ˏ.setText(j.ˋॱ);
            } else {
                this.ˏ.setText(j.ˏॱ);
            }
        }
    }

    public void ॱ(final chy o_chy) {
        OnClickListener anonymousClass1 = new evx(this) {
            final /* synthetic */ ForumRecommendCard ॱ;

            public void ˋ(View view) {
                o_chy.ˏ(0, this.ॱ);
            }
        };
        View ˉ = ˉ();
        if (ˉ != null) {
            ˉ.setOnClickListener(anonymousClass1);
        }
    }
}
